package com.nbsaas.boot.datasource;

import org.springframework.transaction.support.TransactionSynchronizationManager;

public class DataSourceContextHolder {
    public static void setDataSourceType(String dataSourceType) {
        TransactionSynchronizationManager.setCurrentTransactionName(dataSourceType);
    }

    public static String getDataSourceType() {
        return TransactionSynchronizationManager.getCurrentTransactionName();
    }

    public static void clearDataSourceType() {
        TransactionSynchronizationManager.clear();
    }
}
